package com.lanyou.cook.camel.datadictionary;

import java.rmi.NoSuchObjectException;

import org.apache.commons.lang3.StringUtils;

public enum IfEnableType {

	DISABLE("0","不可用"), ENABLE("1","可用");

	public static final String TypeCode = "20009";

	public final String ValueCode;
	public final String ValueName;

	private IfEnableType(String code,String valueName) {
		this.ValueCode = code;
		this.ValueName=valueName;
	}

	public static IfEnableType get(String valueCode)
			throws NoSuchObjectException {
		if (StringUtils.isEmpty(valueCode)) {
			throw new NullPointerException();
		}
		for (IfEnableType type : IfEnableType.values()) {
			if (type.ValueCode.equals(valueCode)) {
				return type;
			}
		}
		throw new NoSuchObjectException(valueCode);
	}
}
